#ifndef ZY_LIGHT_SENSOR_H
#define ZY_LIGHT_SENSOR_H

#include <message.h>
#include <pio.h>
#include "zy_func_def.h"

#ifdef Enable_Light_Sensor
typedef enum
{
    EventLSDetectOFFLED,
    EventLSDetectONLED,
    EventLSDetectOFFLEDRecheck,
    EventLSWear,
    EventLSNoWear,
    EventLSMusicPause,
    EventLSMusicPlay
} LS_Events;

typedef struct
{
    TaskData task;
} LightSensorTaskData;
extern LightSensorTaskData light_sensor_tast;

#define LightSensorGetTaskData() (&light_sensor_tast)

#define LightSensorGetTask() (&light_sensor_tast.task)

void Light_Sensor_Init(Task init_task);
void Light_Sensor_DeInit(void);
void Light_Sensor_Detect_OFFLED(void);
void Light_Sensor_Detect_ONLED(void);
void Light_Sensor_Detect_OFFLED_Recheck(void);
void Wear_State_Operate(void);
void No_Wear_State_Operate(void);
#endif
void set_light_sensor_enabled(bool mode);
bool get_light_sensor_enabled(void);

#endif // ZY_LIGHT_SENSOR_H
